\(\int \arctan (x) \log (1+x^2) \, dx\) [1279]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 9, antiderivative size = 38 \[ \int \arctan (x) \log \left (1+x^2\right ) \, dx=-2 x \arctan (x)+\arctan (x)^2+\log \left (1+x^2\right )+x \arctan (x) \log \left (1+x^2\right )-\frac {1}{4} \log ^2\left (1+x^2\right ) \]

[Out]

-2*x*arctan(x)+arctan(x)^2+ln(x^2+1)+x*arctan(x)*ln(x^2+1)-1/4*ln(x^2+1)^2

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.889, Rules used = {4930, 266, 5129, 2525, 2437, 2338, 5036, 5004} \[ \int \arctan (x) \log \left (1+x^2\right ) \, dx=x \arctan (x) \log \left (x^2+1\right )+\arctan (x)^2-2 x \arctan (x)-\frac {1}{4} \log ^2\left (x^2+1\right )+\log \left (x^2+1\right ) \]

[In]

Int[ArcTan[x]*Log[1 + x^2],x]

[Out]

-2*x*ArcTan[x] + ArcTan[x]^2 + Log[1 + x^2] + x*ArcTan[x]*Log[1 + x^2] - Log[1 + x^2]^2/4

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 2338

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2437

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_.)*(x_))^(q_.), x_Symbol] :> Dist[1/
e, Subst[Int[(f*(x/d))^q*(a + b*Log[c*x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p, q}, x]
 && EqQ[e*f - d*g, 0]

Rule 2525

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))^(q_.)*(x_)^(m_.)*((f_) + (g_.)*(x_)^(s_))^(r_.),
 x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(f + g*x^(s/n))^r*(a + b*Log[c*(d + e*x)^p])^q,
x], x, x^n], x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, q, r, s}, x] && IntegerQ[r] && IntegerQ[s/n] && Intege
rQ[Simplify[(m + 1)/n]] && (GtQ[(m + 1)/n, 0] || IGtQ[q, 0])

Rule 4930

Int[((a_.) + ArcTan[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*ArcTan[c*x^n])^p, x] - Dist[b*c
*n*p, Int[x^n*((a + b*ArcTan[c*x^n])^(p - 1)/(1 + c^2*x^(2*n))), x], x] /; FreeQ[{a, b, c, n}, x] && IGtQ[p, 0
] && (EqQ[n, 1] || EqQ[p, 1])

Rule 5004

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(a + b*ArcTan[c*x])^(p +
 1)/(b*c*d*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[e, c^2*d] && NeQ[p, -1]

Rule 5036

Int[(((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Dist[f^2/
e, Int[(f*x)^(m - 2)*(a + b*ArcTan[c*x])^p, x], x] - Dist[d*(f^2/e), Int[(f*x)^(m - 2)*((a + b*ArcTan[c*x])^p/
(d + e*x^2)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && GtQ[p, 0] && GtQ[m, 1]

Rule 5129

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_.) + Log[(f_.) + (g_.)*(x_)^2]*(e_.)), x_Symbol] :> Simp[x*(d + e*L
og[f + g*x^2])*(a + b*ArcTan[c*x]), x] + (-Dist[b*c, Int[x*((d + e*Log[f + g*x^2])/(1 + c^2*x^2)), x], x] - Di
st[2*e*g, Int[x^2*((a + b*ArcTan[c*x])/(f + g*x^2)), x], x]) /; FreeQ[{a, b, c, d, e, f, g}, x]

Rubi steps \begin{align*} \text {integral}& = x \arctan (x) \log \left (1+x^2\right )-2 \int \frac {x^2 \arctan (x)}{1+x^2} \, dx-\int \frac {x \log \left (1+x^2\right )}{1+x^2} \, dx \\ & = x \arctan (x) \log \left (1+x^2\right )-\frac {1}{2} \text {Subst}\left (\int \frac {\log (1+x)}{1+x} \, dx,x,x^2\right )-2 \int \arctan (x) \, dx+2 \int \frac {\arctan (x)}{1+x^2} \, dx \\ & = -2 x \arctan (x)+\arctan (x)^2+x \arctan (x) \log \left (1+x^2\right )-\frac {1}{2} \text {Subst}\left (\int \frac {\log (x)}{x} \, dx,x,1+x^2\right )+2 \int \frac {x}{1+x^2} \, dx \\ & = -2 x \arctan (x)+\arctan (x)^2+\log \left (1+x^2\right )+x \arctan (x) \log \left (1+x^2\right )-\frac {1}{4} \log ^2\left (1+x^2\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.00 \[ \int \arctan (x) \log \left (1+x^2\right ) \, dx=-2 x \arctan (x)+\arctan (x)^2+\log \left (1+x^2\right )+x \arctan (x) \log \left (1+x^2\right )-\frac {1}{4} \log ^2\left (1+x^2\right ) \]

[In]

Integrate[ArcTan[x]*Log[1 + x^2],x]

[Out]

-2*x*ArcTan[x] + ArcTan[x]^2 + Log[1 + x^2] + x*ArcTan[x]*Log[1 + x^2] - Log[1 + x^2]^2/4

Maple [A] (verified)

Time = 1.19 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.97

method result size
parallelrisch \(-2 x \arctan \left (x \right )+\arctan \left (x \right )^{2}+\ln \left (x^{2}+1\right )+x \arctan \left (x \right ) \ln \left (x^{2}+1\right )-\frac {\ln \left (x^{2}+1\right )^{2}}{4}\) \(37\)
default \(\text {Expression too large to display}\) \(1913\)
risch \(\text {Expression too large to display}\) \(4618\)

[In]

int(arctan(x)*ln(x^2+1),x,method=_RETURNVERBOSE)

[Out]

-2*x*arctan(x)+arctan(x)^2+ln(x^2+1)+x*arctan(x)*ln(x^2+1)-1/4*ln(x^2+1)^2

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.87 \[ \int \arctan (x) \log \left (1+x^2\right ) \, dx=-2 \, x \arctan \left (x\right ) + \arctan \left (x\right )^{2} + {\left (x \arctan \left (x\right ) + 1\right )} \log \left (x^{2} + 1\right ) - \frac {1}{4} \, \log \left (x^{2} + 1\right )^{2} \]

[In]

integrate(arctan(x)*log(x^2+1),x, algorithm="fricas")

[Out]

-2*x*arctan(x) + arctan(x)^2 + (x*arctan(x) + 1)*log(x^2 + 1) - 1/4*log(x^2 + 1)^2

Sympy [A] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.03 \[ \int \arctan (x) \log \left (1+x^2\right ) \, dx=x \log {\left (x^{2} + 1 \right )} \operatorname {atan}{\left (x \right )} - 2 x \operatorname {atan}{\left (x \right )} - \frac {\log {\left (x^{2} + 1 \right )}^{2}}{4} + \log {\left (x^{2} + 1 \right )} + \operatorname {atan}^{2}{\left (x \right )} \]

[In]

integrate(atan(x)*ln(x**2+1),x)

[Out]

x*log(x**2 + 1)*atan(x) - 2*x*atan(x) - log(x**2 + 1)**2/4 + log(x**2 + 1) + atan(x)**2

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.11 \[ \int \arctan (x) \log \left (1+x^2\right ) \, dx={\left (x \log \left (x^{2} + 1\right ) - 2 \, x + 2 \, \arctan \left (x\right )\right )} \arctan \left (x\right ) - \arctan \left (x\right )^{2} - \frac {1}{4} \, \log \left (x^{2} + 1\right )^{2} + \log \left (x^{2} + 1\right ) \]

[In]

integrate(arctan(x)*log(x^2+1),x, algorithm="maxima")

[Out]

(x*log(x^2 + 1) - 2*x + 2*arctan(x))*arctan(x) - arctan(x)^2 - 1/4*log(x^2 + 1)^2 + log(x^2 + 1)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 92 vs. \(2 (36) = 72\).

Time = 0.29 (sec) , antiderivative size = 92, normalized size of antiderivative = 2.42 \[ \int \arctan (x) \log \left (1+x^2\right ) \, dx=\frac {1}{2} \, \pi x \log \left (x^{2} + 1\right ) \mathrm {sgn}\left (x\right ) - x \arctan \left (\frac {1}{x}\right ) \log \left (x^{2} + 1\right ) - \frac {3}{2} \, \pi ^{2} \mathrm {sgn}\left (x\right ) - \pi x \mathrm {sgn}\left (x\right ) - \pi \arctan \left (\frac {1}{x}\right ) \mathrm {sgn}\left (x\right ) + \frac {1}{2} \, \pi ^{2} + \pi \arctan \left (x\right ) + \pi \arctan \left (\frac {1}{x}\right ) + 2 \, x \arctan \left (\frac {1}{x}\right ) + \arctan \left (\frac {1}{x}\right )^{2} - \frac {1}{4} \, \log \left (x^{2} + 1\right )^{2} + \log \left (x^{2} + 1\right ) \]

[In]

integrate(arctan(x)*log(x^2+1),x, algorithm="giac")

[Out]

1/2*pi*x*log(x^2 + 1)*sgn(x) - x*arctan(1/x)*log(x^2 + 1) - 3/2*pi^2*sgn(x) - pi*x*sgn(x) - pi*arctan(1/x)*sgn
(x) + 1/2*pi^2 + pi*arctan(x) + pi*arctan(1/x) + 2*x*arctan(1/x) + arctan(1/x)^2 - 1/4*log(x^2 + 1)^2 + log(x^
2 + 1)

Mupad [B] (verification not implemented)

Time = 0.45 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.03 \[ \int \arctan (x) \log \left (1+x^2\right ) \, dx=\ln \left (x^2+1\right )-\frac {{\ln \left (x^2+1\right )}^2}{4}+{\mathrm {atan}\left (x\right )}^2-x\,\left (2\,\mathrm {atan}\left (x\right )-\ln \left (x^2+1\right )\,\mathrm {atan}\left (x\right )\right ) \]

[In]

int(log(x^2 + 1)*atan(x),x)

[Out]

log(x^2 + 1) - log(x^2 + 1)^2/4 + atan(x)^2 - x*(2*atan(x) - log(x^2 + 1)*atan(x))